#!/usr/bin/env python 
# -*- coding:utf-8 -*-
import requests
import os

BASE_DIR = os.path.dirname(os.path.abspath(__file__))

if __name__ == "__main__":
    url = "http://127.0.0.1:90001"
    input_content = input("输入图片路径：")
    imageFilePath = input_content.strip()
    print(imageFilePath)
    imageFileName = os.path.split(imageFilePath)[1]
    file_dict = {
        'file': (imageFileName, open(imageFilePath, "rb"), 'image/jpg')
    }
    result = requests.post(url, file_dict)
    print(result.text)
